//
//  HomeTableViewCell.m
//  MobileGameLiving
//
//  Created by reflection on 15/8/30.
//  Copyright (c) 2015年 李旭东. All rights reserved.
//

#import "HomeTableViewCell.h"
#import "GameLivingViewController.h"
#import "leftItemView.h"
#import "GameManager.h"

@interface HomeTableViewCell()




@end

@implementation HomeTableViewCell

- (leftItemView *)leftView{
    if (!_leftView) {
        _leftView = [[leftItemView alloc]init];
    }
    return _leftView;
}

-(leftItemView *)rightView{
    if (!_rightView) {
        _rightView = [[leftItemView alloc]init];
    }
    return _rightView;
}

-(void)setIndex:(BOOL)index{
    if (self.rightView) {
        _index = index;
        _index = YES;
    }else if (self.leftView){
        _index = index;
        _index = NO;
    }
}

-(void)setGame:(FRPGame *)game{
    _game = game;
    
//    for (int j = 0; j < [GameManager videos].count; j++) {
//        game = [GameManager videos][j];
//        if ([game.gameName isEqualToString:@"炉石传说"]) {
//            NSLog(@"%@",game.gameName);
//            if (game.tag == 1) {
//                self.leftView.leftImageView.image = [UIImage imageNamed:game.gameIcon];
//                self.leftView.leftLabel.text = game.gamePlayer;
//                
//            }
//        }
//        else if ([game.gameName isEqualToString:@"魔兽世界"]){
//            NSLog(@"%@",game.gameName);
//            if (game.tag == 1) {
//                self.leftView.leftImageView.image = [UIImage imageNamed:game.gameIcon];
//                self.leftView.leftLabel.text = game.gamePlayer;
//            }
//        }
//    }
    
    
    
    
//    UITapGestureRecognizer *rightSingleTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(rightSingleTap:)];
//    rightSingleTap.numberOfTapsRequired = 1;
//    [self.contentView addGestureRecognizer:rightSingleTap];
}

//- (void)gameLivingPageTurn:(UIButton *)sender{
//
//        if(sender.tag == 1){
//            GameLivingViewController *gameLVC = [[GameLivingViewController alloc]initWithNibName:@"GameLivingViewController" bundle:nil];
//            
//        }
//        else if(sender.tag == 2){
//            GameLivingViewController *gameLVC = [[GameLivingViewController alloc]initWithNibName:@"GameLivingViewController" bundle:nil];
//            
//        }
//}

//-(void)checkAction:(UIButton *)sender{
//    if ([_delegate respondsToSelector:@selector(seguePage:)]) {
//        sender.tag = self.tag;
//        [_delegate seguePage:sender];
//    }
//}

//-(void)pageDidClickWithPlayerName:(NSString *)playerName{
//    NSLog(@"selected pageNumber is %@",playerName);
//    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithFormat:@"%@在玩游戏",playerName]
//                                                    message:nil
//                                                   delegate:nil
//                                          cancelButtonTitle:@"确定"
//                                          otherButtonTitles:nil, nil];
//    
//    [alert show];
//}

//- (void)singleTap:(UITapGestureRecognizer *)tapGesTure{
//    
//    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"左边" message:nil delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
//    [alert show];
//    
//}


- (void)awakeFromNib {
    // Initialization code
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}



@end
